﻿using BCCommon.TMS.FreightEnums;
using BCEntity.TMS.HorsemanFreightExtention;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.HorsemanFreightExtention
{
    public interface IHorsemanFreightExtentionData
    {

        /// <summary>
        /// 新增骑手运费扩展
        /// </summary>
        /// <param name="entity">骑手运费扩展信息</param>
        /// <returns></returns>
        Task<HorsemanFreightExtentionEntity> InserAsync(HorsemanFreightExtentionEntity entity);
        /// <summary>
        /// 批量新增骑手运费扩展
        /// </summary>
        /// <param name="entities">骑手运费扩展信息列表</param>
        /// <returns></returns>
        Task<int> InserAllAsync(List<HorsemanFreightExtentionEntity> entities);


        /// <summary>
        /// 检查骑手运费扩展是否存在
        /// </summary>
        /// <param name="horsemanFreightExtentionId">骑手运费扩展Id</param>
        /// <returns></returns>
        Task<bool> CheckExistsAsync(long horsemanFreightExtentionId);
        /// <summary>
        /// 检查骑手运费扩展是否存在
        /// </summary>
        /// <param name="countyCode">区县编码</param>
        /// <returns></returns>
        Task<bool> CheckExistsAsync(string countyCode);

        /// <summary>
        /// 修改骑手运费扩展
        /// </summary>
        /// <param name="entity">骑手运费扩展信息</param>
        /// <returns></returns>
        Task<HorsemanFreightExtentionEntity> UpdateAsync(HorsemanFreightExtentionEntity entity);
        /// <summary>
        /// 批量修改骑手运费扩展
        /// </summary>
        /// <param name="entities">骑手运费扩展信息</param>
        /// <returns></returns>
        Task<bool> UpdateAllAsync(string countycode, List<HorsemanFreightExtentionEntity> entities);

        /// <summary>
        /// 删除骑手运费扩展
        /// </summary>
        /// <param name="horsemanFreightExtentionId">运费扩展id</param>
        /// <returns></returns>
        Task<bool> DeleteAsync(long horsemanFreightExtentionId);


        /// <summary>
        /// 获取骑手运费扩展（分页）
        /// </summary> 
        /// <param name="isBase">是否是基础骑手运费扩展</param>     
        /// <param name="countyCodes">区县编码列表</param>  
        /// <param name="ascending">是否升序排序</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页条数</param>
        Task<(IEnumerable<HorsemanFreightExtentionViewEntity>, int)> GetListAsync(bool? isBase, List<string> countyCodes, HorsemanFreightExtentionType? freightExtentionType, bool? ascending, string sortName, int pageIndex, int pageSize);


        /// <summary>
        /// 根据区县编码获取骑手运费扩展
        /// </summary>
        /// <param name="horsemanFreightExtentionId">骑手运费扩展Id</param>
        /// <returns></returns>
        Task<HorsemanFreightExtentionEntity> GetByHorsemanFreightExtentionIdAsync(long horsemanFreightExtentionId);

        /// <summary>
        /// 分页获取骑手运费阶梯表信息
        /// </summary>
        /// <param name="countyCode">区县编码</param>
        /// <returns></returns>
        Task<IEnumerable<HorsemanFreightExtentionEntity>> GetListByCountyCodeAsync(string countyCode);
        /// <summary>
        /// 获取骑手运费阶梯表基本信息
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<HorsemanFreightExtentionEntity>> GetListAsync();
    }
}
